public final class Npc extends Entity {
	public EntityDefinition desc;

	@Override
	public Model getRotatedModel() {
		if (desc == null) {
			return null;
		}
		Model model = method450();
		if (model == null) {
			return null;
		}
		super.height = model.modelHeight;
		if ((super.anInt1520 != -1) && (super.anInt1521 != -1)) {
			SpotAnimation spotAnimation = SpotAnimation.cache[super.anInt1520];
			Model model_1 = spotAnimation.getModel();
			if (model_1 != null) {
				int j = spotAnimation.aAnimation_407.anIntArray353[super.anInt1521];
				Model model_2 = new Model(true, FrameReader.method532(j), false,
				model_1);
				model_2.method475(0, -super.anInt1524, 0);
				model_2.method469();
				model_2.method470(j);
				model_2.anIntArrayArray1658 = null;
				model_2.anIntArrayArray1657 = null;
				if ((spotAnimation.anInt410 != 128) || (spotAnimation.anInt411 != 128)) {
					model_2.method478(spotAnimation.anInt410, spotAnimation.anInt410,
					spotAnimation.anInt411);
				}
				model_2.preProcess(64 + spotAnimation.anInt413, 850 + spotAnimation.anInt414,
				-30, -50, -30, true);
				Model aModel[] = { model, model_2 };
				model = new Model(aModel);
			}
		}
		if (desc.aByte68 == 1) {
			model.aBoolean1659 = true;
		}
		return model;
	}

	@Override
	public boolean isVisible() {
		return desc != null;
	}

	private Model method450() {
		if ((super.currentAnimation >= 0) && (super.animationDelay == 0)) {
			int k = Animation.animations[super.currentAnimation].anIntArray353[super.anInt1527];
			int i1 = -1;
			if ((super.anInt1517 >= 0) && (super.anInt1517 != super.idleAnimation)) {
				i1 = Animation.animations[super.anInt1517].anIntArray353[super.anInt1518];
			}
			return desc
			.method164(i1, k, Animation.animations[super.currentAnimation].anIntArray357);
		}
		int l = -1;
		if (super.anInt1517 >= 0) {
			l = Animation.animations[super.anInt1517].anIntArray353[super.anInt1518];
		}
		return desc.method164(-1, l, null);
	}

	Npc() {
	}
}
